<?php
//使用命令行运行PHP代码
header("content-type:text/html;charset=utf-8");
$start=microtime(true);
$link= new  PDO('mysql:host=127.0.0.1;dbname=1704phpA','root','');
$link->exec('set  names utf8');
$sql="insert  into  user('user_name') values";
for($i=0;$i<5000;$i++){
   $str='zxcvbnmasdfghjklqwertyuiop';
    $name="";
   for($j=0;$j<15;$j++){
       $name.= $str[rand(0,25)];
   }
    $sql.="('$name'),";
    $sql=substr($sql,0,-1);
}
$link->exec($sql);
$end=microtime(true);
echo $end-$start;
/*echo $sql;*/